package com.geovis.emergency.spd.entity.basic.pojo.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.geovis.emergency.spd.entity.system.pojo.node.INode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Lonsho
 * @version 1.0
 * @date 2022/7/12
 */
@Data
public class ShareDocTreeVO implements INode<ShareDocTreeVO> {

    /**
     * 主键id
     */
    @ApiModelProperty(value = "主键id")
    private String id;
    /**
     * 文件名
     */
    @ApiModelProperty(value = "文件名")
    private String name;

    @ApiModelProperty(value = "文件id")
    private String fileId;

    @ApiModelProperty(value = "文件url")
    private String url;

    @ApiModelProperty("文件扩展名")
    private String fileExt;

    @ApiModelProperty("文件类型")
    private String fileType;

    @ApiModelProperty("文件扩展名")
    private Long fileSize;

    @ApiModelProperty("remark")
    private String remark;

    /**
     * 文件类型 Folder/File
     */
    @ApiModelProperty(value = "文件类型")
    private String type;


    @ApiModelProperty(value = "文件夹id")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String folderId;

    @ApiModelProperty(value = "父节点id")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private  String parentId;

    @ApiModelProperty(value = "子集列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<ShareDocTreeVO> children;

    /**
     * 是否有子孙节点
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean hasChildren;

    @Override
    public List<ShareDocTreeVO> getChildren() {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        return children;
    }

}
